<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript" src="<c:url value="/js/jquery-3.0.0.min.js"/>"></script>
</head>
<body>

    <input type="hidden" name="url" id="url"/>
    

<script type="text/javascript">

$(function(){
	var _serviceURL = '/69mark';
	var toUrl = "www.69mark.com/69mark/toUrlIntro.do";
	//var url = encodeURIComponent(location.href.split('#')[0]);
	var ssId = _geturlparam('ssId');
	var url2 = location.href.split('#')[0];
    
	var b = url2.split("?");
	var url = toUrl + "?"+ b[1];
	url =  encodeURIComponent(url);
	
	$.ajax({
        type : "POST",
        url : _serviceURL+"/toUrlIntro.do",
        cache : false,
        data : "ssId="+ssId+"&url="+url,
        dataType : 'json',
        success : function(data) {
        	alert(11);
        }
	})
	
	
	
	/* $("#url").val(url);
    window.location.href = _serviceURL+"/toUrlIntro.do?ssId="+ssId; */
})

var _geturlparam = function(name) {
    if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)'))
            .exec(location.search))
        return decodeURIComponent(name[1]);
};


//1.首次加载的时候，计算rem赋值给根元素里面的font-size。
setRemSize();
//2.当用户更改浏览器宽度自动获取屏幕宽度，再计算rem赋值给根元素里面的font-size
window.addEventListener("resize",setRemSize,false);
function setRemSize(){
    //获取rem值    rem =100 * (屏幕宽度 / 设计稿宽度) +"px";
    var _clientWidth=100*(document.documentElement.clientWidth / 576) + "px";
    //判断，是否屏幕宽度大于设计稿宽度
    if (document.documentElement.clientWidth >= 576) {
        //如果是，用设计稿的宽度作为rem的值赋给根元素的font-size
        document.documentElement.style.fontSize="100px";
    } else {
        //如果不是，将得到的rem值赋给根元素的font-size
        document.documentElement.style.fontSize=_clientWidth;
    }
};

/*lunbo*/
var swiper = new Swiper('.swiper-container');
/*navs*/
var swiper = new Swiper('.swiper-container1', {
    pagination: '.swiper-pagination1',
    paginationClickable: true
});
var swiper = new Swiper('.swiper-container3');

var myScroll;

function loaded () {
    myScroll = new IScroll('#wrapper', {
        scrollbars: true,
        mouseWheel: true,
        interactiveScrollbars: true,
        shrinkScrollbars: 'scale',
        fadeScrollbars: true,
        preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|A)$/ }
    });
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

var noncestr = $("#noncestr").val();
var timestamp = $("#timestamp").val();
var signature = $("#signature").val();
var appId = $("#appId").val();

wx.config({  
    debug: true,  
    appId: ''+appId+'',  
    timestamp: ''+timestamp+'',
    nonceStr: ''+noncestr+'',  
    signature: ''+signature+'',  
    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage']  
});  

wx.ready(function () {  
    alert('ready  12346');
    wx.onMenuShareTimeline({  
        title: '这是标题', // 分享标题  
        link: 'http://www.69mark.com', // 分享链接  
        imgUrl: 'http://escloud-media.oss-cn-hangzhou.aliyuncs.com/escloud/newsmsg-small.png', // 分享图标  
        success: function () {  
            // 用户确认分享后执行的回调函数  
            alert("分享成功");
     },  
     cancel: function () {  
         // 用户取消分享后执行的回调函数 
         alert("分享取消");
     },  
     fail: function (res) {  
         alert("分享失败，请重新尝试");  
        }  
    });  
    wx.onMenuShareAppMessage({  
        title: '胶囊内镜检查图片', // 分享标题  
        desc: '胶囊内镜检查图片', // 分享描述  
        link: 'http://www.69mark.com', // 分享链接
        imgUrl: 'http://escloud-media.oss-cn-hangzhou.aliyuncs.com/escloud/newsmsg-small.png', // 分享图标  
        type: 'link', // 分享类型,music、video或link，不填默认为link  
        dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空  
        success: function () {  
            // 用户确认分享后执行的回调函数  
        },  
        cancel: function () {  
            // 用户取消分享后执行的回调函数  
        }  
   }); 
});  

</script>

</body>
</html>